﻿


/*
以下代码使用T4自动生成，如果修改那么重新生成后将丢失！
*/
using System.Xml.Linq;
using System.Xml;
using System.Text;
using System.Collections.Generic;




namespace YLPublicService.TransferModel
{
    public class Template
    {
				/// <summary>
		/// 模板名字
		/// </summary>
		public string mName;
			/// <summary>
		/// 价格
		/// </summary>
		public string mPrice;
	    public class RequireValues
    {
					    public class Item
    {
				/// <summary>
		/// 参数名
		/// </summary>
		public string mName;
			/// <summary>
		/// 数据类型
		/// </summary>
		public string mDataType;
			/// <summary>
		/// 
		/// </summary>
		public string mMemo;
	            public static Item FromXML(string value)
            {
            var root =XElement.Parse(value);
             return FromXML(root);
            }
        	public static Item FromXML(XElement value)
			{
				var root=value;
				var _Item=new Item();

											_Item.mName=root.Element("Name").Value;
				  							_Item.mDataType=root.Element("DataType").Value;
				  							_Item.mMemo=root.Element("Memo").Value;
				  				return _Item;
			}
          public override string ToString()
        {
            StringBuilder sb =new StringBuilder();
            sb.Append("<Item>");
                sb.AppendFormat("<Name>{0}</Name>",this.mName	.ToString());
                    sb.AppendFormat("<DataType>{0}</DataType>",this.mDataType	.ToString());
                    sb.AppendFormat("<Memo>{0}</Memo>",this.mMemo	.ToString());
                sb.Append("</Item>");
             return sb.ToString();
            }
    }
		public  List<Item> mItem =new List<Item>();
			            public static RequireValues FromXML(string value)
            {
            var root =XElement.Parse(value);
             return FromXML(root);
            }
        	public static RequireValues FromXML(XElement value)
			{
				var root=value;
				var _RequireValues=new RequireValues();

								  foreach(XElement child in root.Elements())
				  {
				  					_RequireValues.mItem.Add(Item.FromXML(child.ToString()));
									}
									return _RequireValues;
			}
          public override string ToString()
        {
            StringBuilder sb =new StringBuilder();
            sb.Append("<RequireValues>");
            foreach(var child in mItem)
            {                 sb.AppendFormat("{0}",child.ToString());
            }
                    sb.Append("</RequireValues>");
             return sb.ToString();
            }
    }
            
		/// <summary>
		/// 参数名数据类型
		/// </summary>
		public RequireValues mRequireValues= new RequireValues();                                                                                                                                                                  
    public class RequireAttchments
    {
					    public class Item
    {
				/// <summary>
		/// 参数名
		/// </summary>
		public string mName;
			/// <summary>
		/// 数据类型
		/// </summary>
		public string mDataType;
			/// <summary>
		/// 
		/// </summary>
		public string mMemo;
	            public static Item FromXML(string value)
            {
            var root =XElement.Parse(value);
             return FromXML(root);
            }
        	public static Item FromXML(XElement value)
			{
				var root=value;
				var _Item=new Item();

											_Item.mName=root.Element("Name").Value;
				  							_Item.mDataType=root.Element("DataType").Value;
				  							_Item.mMemo=root.Element("Memo").Value;
				  				return _Item;
			}
          public override string ToString()
        {
            StringBuilder sb =new StringBuilder();
            sb.Append("<Item>");
                sb.AppendFormat("<Name>{0}</Name>",this.mName	.ToString());
                    sb.AppendFormat("<DataType>{0}</DataType>",this.mDataType	.ToString());
                    sb.AppendFormat("<Memo>{0}</Memo>",this.mMemo	.ToString());
                sb.Append("</Item>");
             return sb.ToString();
            }
    }
		public  List<Item> mItem =new List<Item>();
			            public static RequireAttchments FromXML(string value)
            {
            var root =XElement.Parse(value);
             return FromXML(root);
            }
        	public static RequireAttchments FromXML(XElement value)
			{
				var root=value;
				var _RequireAttchments=new RequireAttchments();

								  foreach(XElement child in root.Elements())
				  {
				  					_RequireAttchments.mItem.Add(Item.FromXML(child.ToString()));
									}
									return _RequireAttchments;
			}
          public override string ToString()
        {
            StringBuilder sb =new StringBuilder();
            sb.Append("<RequireAttchments>");
            foreach(var child in mItem)
            {                 sb.AppendFormat("{0}",child.ToString());
            }
                    sb.Append("</RequireAttchments>");
             return sb.ToString();
            }
    }
            
		/// <summary>
		/// 参数名数据类型
		/// </summary>
		public RequireAttchments mRequireAttchments= new RequireAttchments();                                                                                                                                                                  
            public static Template FromXML(string value)
            {
            var root =XElement.Parse(value);
             return FromXML(root);
            }
        	public static Template FromXML(XElement value)
			{
				var root=value;
				var _Template=new Template();

											_Template.mName=root.Element("Name").Value;
				  							_Template.mPrice=root.Element("Price").Value;
				  						 _Template.mRequireValues=RequireValues.FromXML(root.Element("RequireValues").ToString());
				 						 _Template.mRequireAttchments=RequireAttchments.FromXML(root.Element("RequireAttchments").ToString());
				 				return _Template;
			}
          public override string ToString()
        {
            StringBuilder sb =new StringBuilder();
            sb.Append("<Template>");
                sb.AppendFormat("<Name>{0}</Name>",this.mName	.ToString());
                    sb.AppendFormat("<Price>{0}</Price>",this.mPrice	.ToString());
            sb.Append(this.mRequireValues.ToString());
        sb.Append(this.mRequireAttchments.ToString());
            sb.Append("</Template>");
             return sb.ToString();
            }
    }

}